package org.jeecg.modules.online.cgform.utils;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.jeecg.modules.online.cgform.entity.OnlCgformButton;
import org.jeecg.modules.online.cgform.enums.CgformConstant;
import org.springframework.beans.BeanUtils;

/* renamed from: org.jeecg.modules.online.cgform.d.a */
/* loaded from: hibernate-re-3.7.1-RC.jar:org/jeecg/modules/online/cgform/d/a.class */
public class BuiltInButtonUtils {

    /* renamed from: a */
    private static final List<OnlCgformButton> f195a = new ArrayList();

    /* renamed from: b */
    private static final Set<String> f196b = new HashSet();

    static {
        int i = 0 + 1;
        m390a(CgformConstant.f374i, "新增", "plus-outlined", i);
        int i2 = i + 1;
        m390a(CgformConstant.f375j, "编辑", "", i2);
        int i3 = i2 + 1;
        m390a("detail", "详情", "", i3);
        int i4 = i3 + 1;
        m390a(CgformConstant.f376k, "删除", "", i4);
        int i5 = i4 + 1;
        m390a("batch_delete", "批量删除", "delete-outlined", i5);
        int i6 = i5 + 1;
        m390a("import", "导入", "import-outlined", i6);
        int i7 = i6 + 1;
        m390a("export", "导出", "export-outlined", i7);
        int i8 = i7 + 1;
        m390a("query", "查询", "search", i8);
        int i9 = i8 + 1;
        m390a("reset", "重置", "reload", i9);
        int i10 = i9 + 1;
        m390a("bpm", "提交流程", "", i10);
        int i11 = i10 + 1;
        m390a("super_query", "高级查询", "filter-outlined", i11);
        m390a("form_confirm", "确定", "", i11 + 1);
    }

    /* renamed from: a */
    private static void m390a(String str, String str2, String str3, int i) {
        OnlCgformButton onlCgformButton = new OnlCgformButton();
        onlCgformButton.setButtonCode(str);
        onlCgformButton.setButtonName(str2);
        onlCgformButton.setButtonIcon(str3);
        onlCgformButton.setOrderNum(Integer.valueOf(i));
        onlCgformButton.setButtonStyle("built-in");
        onlCgformButton.setButtonStatus("1");
        f195a.add(onlCgformButton);
        f196b.add(str);
    }

    public static Set<String> getButtonCodeSet() {
        return f196b;
    }

    /* renamed from: a */
    public static List<OnlCgformButton> m389a(String str, List<OnlCgformButton> list) {
        List<OnlCgformButton> arrayList = new ArrayList();
        for (OnlCgformButton onlCgformButton : f195a) {
            OnlCgformButton orElse = list.stream().filter(onlCgformButton2 -> {
                return onlCgformButton.getButtonCode().equals(onlCgformButton2.getButtonCode());
            }).findFirst().orElse(null);
            if (orElse == null) {
                OnlCgformButton onlCgformButton3 = new OnlCgformButton();
                BeanUtils.copyProperties(onlCgformButton, onlCgformButton3);
                onlCgformButton3.setCgformHeadId(str);
                arrayList.add(onlCgformButton3);
            } else {
                orElse.setOrderNum(onlCgformButton.getOrderNum());
                arrayList.add(orElse);
            }
        }
        arrayList.sort(Comparator.comparing((v0) -> {
            return v0.getOrderNum();
        }));
        return arrayList;
    }
}
